package com.easemob.chat;

import android.app.Notification;
import android.app.PendingIntent;
import android.content.Context;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Build.VERSION;
import android.widget.RemoteViews;
import java.util.ArrayList;
import java.util.Iterator;

public class NotificationCompat
{
  public static final int FLAG_HIGH_PRIORITY = 128;
  public static final int PRIORITY_DEFAULT = 0;
  public static final int PRIORITY_LOW = -1;
  public static final int PRIORITY_MIN = -2;
  public static final int PRIORITY_HIGH = 1;
  public static final int PRIORITY_MAX = 2;
  private static final NotificationCompatImpl IMPL;

  static
  {
    if (Build.VERSION.SDK_INT >= 16)
      IMPL = new NotificationCompatImplJellybean();
    else if (Build.VERSION.SDK_INT >= 14)
      IMPL = new NotificationCompatImplIceCreamSandwich();
    else if (Build.VERSION.SDK_INT >= 11)
      IMPL = new NotificationCompatImplHoneycomb();
    else if (Build.VERSION.SDK_INT >= 9)
      IMPL = new NotificationCompatImplGingerbread();
    else
      IMPL = new NotificationCompatImplBase();
  }

  public static class Action
  {
    public int icon;
    public CharSequence title;
    public PendingIntent actionIntent;

    public Action(int paramInt, CharSequence paramCharSequence, PendingIntent paramPendingIntent)
    {
      this.icon = paramInt;
      this.title = paramCharSequence;
      this.actionIntent = paramPendingIntent;
    }
  }

  public static class BigPictureStyle extends NotificationCompat.Style
  {
    Bitmap mPicture;
    Bitmap mBigLargeIcon;
    boolean mBigLargeIconSet;

    public BigPictureStyle()
    {
    }

    public BigPictureStyle(NotificationCompat.Builder paramBuilder)
    {
      setBuilder(paramBuilder);
    }

    public BigPictureStyle setBigContentTitle(CharSequence paramCharSequence)
    {
      this.mBigContentTitle = paramCharSequence;
      return this;
    }

    public BigPictureStyle setSummaryText(CharSequence paramCharSequence)
    {
      this.mSummaryText = paramCharSequence;
      this.mSummaryTextSet = true;
      return this;
    }

    public BigPictureStyle bigPicture(Bitmap paramBitmap)
    {
      this.mPicture = paramBitmap;
      return this;
    }

    public BigPictureStyle bigLargeIcon(Bitmap paramBitmap)
    {
      this.mBigLargeIcon = paramBitmap;
      this.mBigLargeIconSet = true;
      return this;
    }
  }

  public static class BigTextStyle extends NotificationCompat.Style
  {
    CharSequence mBigText;

    public BigTextStyle()
    {
    }

    public BigTextStyle(NotificationCompat.Builder paramBuilder)
    {
      setBuilder(paramBuilder);
    }

    public BigTextStyle setBigContentTitle(CharSequence paramCharSequence)
    {
      this.mBigContentTitle = paramCharSequence;
      return this;
    }

    public BigTextStyle setSummaryText(CharSequence paramCharSequence)
    {
      this.mSummaryText = paramCharSequence;
      this.mSummaryTextSet = true;
      return this;
    }

    public BigTextStyle bigText(CharSequence paramCharSequence)
    {
      this.mBigText = paramCharSequence;
      return this;
    }
  }

  public static class Builder
  {
    Context mContext;
    CharSequence mContentTitle;
    CharSequence mContentText;
    PendingIntent mContentIntent;
    PendingIntent mFullScreenIntent;
    RemoteViews mTickerView;
    Bitmap mLargeIcon;
    CharSequence mContentInfo;
    int mNumber;
    int mPriority;
    boolean mUseChronometer;
    NotificationCompat.Style mStyle;
    CharSequence mSubText;
    int mProgressMax;
    int mProgress;
    boolean mProgressIndeterminate;
    ArrayList<NotificationCompat.Action> mActions = new ArrayList();
    Notification mNotification = new Notification();

    public Builder(Context paramContext)
    {
      this.mContext = paramContext;
      this.mNotification.when = System.currentTimeMillis();
      this.mNotification.audioStreamType = -1;
      this.mPriority = 0;
    }

    public Builder setWhen(long paramLong)
    {
      this.mNotification.when = paramLong;
      return this;
    }

    public Builder setUsesChronometer(boolean paramBoolean)
    {
      this.mUseChronometer = paramBoolean;
      return this;
    }

    public Builder setSmallIcon(int paramInt)
    {
      this.mNotification.icon = paramInt;
      return this;
    }

    public Builder setSmallIcon(int paramInt1, int paramInt2)
    {
      this.mNotification.icon = paramInt1;
      this.mNotification.iconLevel = paramInt2;
      return this;
    }

    public Builder setContentTitle(CharSequence paramCharSequence)
    {
      this.mContentTitle = paramCharSequence;
      return this;
    }

    public Builder setContentText(CharSequence paramCharSequence)
    {
      this.mContentText = paramCharSequence;
      return this;
    }

    public Builder setSubText(CharSequence paramCharSequence)
    {
      this.mSubText = paramCharSequence;
      return this;
    }

    public Builder setNumber(int paramInt)
    {
      this.mNumber = paramInt;
      return this;
    }

    public Builder setContentInfo(CharSequence paramCharSequence)
    {
      this.mContentInfo = paramCharSequence;
      return this;
    }

    public Builder setProgress(int paramInt1, int paramInt2, boolean paramBoolean)
    {
      this.mProgressMax = paramInt1;
      this.mProgress = paramInt2;
      this.mProgressIndeterminate = paramBoolean;
      return this;
    }

    public Builder setContent(RemoteViews paramRemoteViews)
    {
      this.mNotification.contentView = paramRemoteViews;
      return this;
    }

    public Builder setContentIntent(PendingIntent paramPendingIntent)
    {
      this.mContentIntent = paramPendingIntent;
      return this;
    }

    public Builder setDeleteIntent(PendingIntent paramPendingIntent)
    {
      this.mNotification.deleteIntent = paramPendingIntent;
      return this;
    }

    public Builder setFullScreenIntent(PendingIntent paramPendingIntent, boolean paramBoolean)
    {
      this.mFullScreenIntent = paramPendingIntent;
      setFlag(128, paramBoolean);
      return this;
    }

    public Builder setTicker(CharSequence paramCharSequence)
    {
      this.mNotification.tickerText = paramCharSequence;
      return this;
    }

    public Builder setTicker(CharSequence paramCharSequence, RemoteViews paramRemoteViews)
    {
      this.mNotification.tickerText = paramCharSequence;
      this.mTickerView = paramRemoteViews;
      return this;
    }

    public Builder setLargeIcon(Bitmap paramBitmap)
    {
      this.mLargeIcon = paramBitmap;
      return this;
    }

    public Builder setSound(Uri paramUri)
    {
      this.mNotification.sound = paramUri;
      this.mNotification.audioStreamType = -1;
      return this;
    }

    public Builder setSound(Uri paramUri, int paramInt)
    {
      this.mNotification.sound = paramUri;
      this.mNotification.audioStreamType = paramInt;
      return this;
    }

    public Builder setVibrate(long[] paramArrayOfLong)
    {
      this.mNotification.vibrate = paramArrayOfLong;
      return this;
    }

    public Builder setLights(int paramInt1, int paramInt2, int paramInt3)
    {
      this.mNotification.ledARGB = paramInt1;
      this.mNotification.ledOnMS = paramInt2;
      this.mNotification.ledOffMS = paramInt3;
      int i = (this.mNotification.ledOnMS != 0) && (this.mNotification.ledOffMS != 0) ? 1 : 0;
      this.mNotification.flags = (this.mNotification.flags & 0xFFFFFFFE | (i != 0 ? 1 : 0));
      return this;
    }

    public Builder setOngoing(boolean paramBoolean)
    {
      setFlag(2, paramBoolean);
      return this;
    }

    public Builder setOnlyAlertOnce(boolean paramBoolean)
    {
      setFlag(8, paramBoolean);
      return this;
    }

    public Builder setAutoCancel(boolean paramBoolean)
    {
      setFlag(16, paramBoolean);
      return this;
    }

    public Builder setDefaults(int paramInt)
    {
      this.mNotification.defaults = paramInt;
      if ((paramInt & 0x4) != 0)
        this.mNotification.flags |= 1;
      return this;
    }

    private void setFlag(int paramInt, boolean paramBoolean)
    {
      if (paramBoolean)
        this.mNotification.flags |= paramInt;
      else
        this.mNotification.flags &= (paramInt ^ 0xFFFFFFFF);
    }

    public Builder setPriority(int paramInt)
    {
      this.mPriority = paramInt;
      return this;
    }

    public Builder addAction(int paramInt, CharSequence paramCharSequence, PendingIntent paramPendingIntent)
    {
      this.mActions.add(new NotificationCompat.Action(paramInt, paramCharSequence, paramPendingIntent));
      return this;
    }

    public Builder setStyle(NotificationCompat.Style paramStyle)
    {
      if (this.mStyle != paramStyle)
      {
        this.mStyle = paramStyle;
        if (this.mStyle != null)
          this.mStyle.setBuilder(this);
      }
      return this;
    }

    @Deprecated
    public Notification getNotification()
    {
      return NotificationCompat.IMPL.build(this);
    }

    public Notification build()
    {
      return NotificationCompat.IMPL.build(this);
    }
  }

  public static class InboxStyle extends NotificationCompat.Style
  {
    ArrayList<CharSequence> mTexts = new ArrayList();

    public InboxStyle()
    {
    }

    public InboxStyle(NotificationCompat.Builder paramBuilder)
    {
      setBuilder(paramBuilder);
    }

    public InboxStyle setBigContentTitle(CharSequence paramCharSequence)
    {
      this.mBigContentTitle = paramCharSequence;
      return this;
    }

    public InboxStyle setSummaryText(CharSequence paramCharSequence)
    {
      this.mSummaryText = paramCharSequence;
      this.mSummaryTextSet = true;
      return this;
    }

    public InboxStyle addLine(CharSequence paramCharSequence)
    {
      this.mTexts.add(paramCharSequence);
      return this;
    }
  }

  static abstract interface NotificationCompatImpl
  {
    public abstract Notification build(NotificationCompat.Builder paramBuilder);
  }

  static class NotificationCompatImplBase
    implements NotificationCompat.NotificationCompatImpl
  {
    public Notification build(NotificationCompat.Builder paramBuilder)
    {
      Notification localNotification = paramBuilder.mNotification;
      localNotification.setLatestEventInfo(paramBuilder.mContext, paramBuilder.mContentTitle, paramBuilder.mContentText, paramBuilder.mContentIntent);
      if (paramBuilder.mPriority > 0)
        localNotification.flags |= 128;
      return localNotification;
    }
  }

  static class NotificationCompatImplGingerbread extends NotificationCompat.NotificationCompatImplBase
  {
    public Notification build(NotificationCompat.Builder paramBuilder)
    {
      Notification localNotification = paramBuilder.mNotification;
      localNotification.setLatestEventInfo(paramBuilder.mContext, paramBuilder.mContentTitle, paramBuilder.mContentText, paramBuilder.mContentIntent);
      localNotification = NotificationCompatGingerbread.add(localNotification, paramBuilder.mContext, paramBuilder.mContentTitle, paramBuilder.mContentText, paramBuilder.mContentIntent, paramBuilder.mFullScreenIntent);
      if (paramBuilder.mPriority > 0)
        localNotification.flags |= 128;
      return localNotification;
    }
  }

  static class NotificationCompatImplHoneycomb
    implements NotificationCompat.NotificationCompatImpl
  {
    public Notification build(NotificationCompat.Builder paramBuilder)
    {
      return NotificationCompatHoneycomb.add(paramBuilder.mContext, paramBuilder.mNotification, paramBuilder.mContentTitle, paramBuilder.mContentText, paramBuilder.mContentInfo, paramBuilder.mTickerView, paramBuilder.mNumber, paramBuilder.mContentIntent, paramBuilder.mFullScreenIntent, paramBuilder.mLargeIcon);
    }
  }

  static class NotificationCompatImplIceCreamSandwich
    implements NotificationCompat.NotificationCompatImpl
  {
    public Notification build(NotificationCompat.Builder paramBuilder)
    {
      return NotificationCompatIceCreamSandwich.add(paramBuilder.mContext, paramBuilder.mNotification, paramBuilder.mContentTitle, paramBuilder.mContentText, paramBuilder.mContentInfo, paramBuilder.mTickerView, paramBuilder.mNumber, paramBuilder.mContentIntent, paramBuilder.mFullScreenIntent, paramBuilder.mLargeIcon, paramBuilder.mProgressMax, paramBuilder.mProgress, paramBuilder.mProgressIndeterminate);
    }
  }

  static class NotificationCompatImplJellybean
    implements NotificationCompat.NotificationCompatImpl
  {
    public Notification build(NotificationCompat.Builder paramBuilder)
    {
      NotificationCompatJellybean localNotificationCompatJellybean = new NotificationCompatJellybean(paramBuilder.mContext, paramBuilder.mNotification, paramBuilder.mContentTitle, paramBuilder.mContentText, paramBuilder.mContentInfo, paramBuilder.mTickerView, paramBuilder.mNumber, paramBuilder.mContentIntent, paramBuilder.mFullScreenIntent, paramBuilder.mLargeIcon, paramBuilder.mProgressMax, paramBuilder.mProgress, paramBuilder.mProgressIndeterminate, paramBuilder.mUseChronometer, paramBuilder.mPriority, paramBuilder.mSubText);
      Iterator localIterator = paramBuilder.mActions.iterator();
      Object localObject;
      while (localIterator.hasNext())
      {
        localObject = (NotificationCompat.Action)localIterator.next();
        localNotificationCompatJellybean.addAction(((NotificationCompat.Action)localObject).icon, ((NotificationCompat.Action)localObject).title, ((NotificationCompat.Action)localObject).actionIntent);
      }
      if (paramBuilder.mStyle != null)
        if ((paramBuilder.mStyle instanceof NotificationCompat.BigTextStyle))
        {
          localObject = (NotificationCompat.BigTextStyle)paramBuilder.mStyle;
          localNotificationCompatJellybean.addBigTextStyle(((NotificationCompat.BigTextStyle)localObject).mBigContentTitle, ((NotificationCompat.BigTextStyle)localObject).mSummaryTextSet, ((NotificationCompat.BigTextStyle)localObject).mSummaryText, ((NotificationCompat.BigTextStyle)localObject).mBigText);
        }
        else if ((paramBuilder.mStyle instanceof NotificationCompat.InboxStyle))
        {
          localObject = (NotificationCompat.InboxStyle)paramBuilder.mStyle;
          localNotificationCompatJellybean.addInboxStyle(((NotificationCompat.InboxStyle)localObject).mBigContentTitle, ((NotificationCompat.InboxStyle)localObject).mSummaryTextSet, ((NotificationCompat.InboxStyle)localObject).mSummaryText, ((NotificationCompat.InboxStyle)localObject).mTexts);
        }
        else if ((paramBuilder.mStyle instanceof NotificationCompat.BigPictureStyle))
        {
          localObject = (NotificationCompat.BigPictureStyle)paramBuilder.mStyle;
          localNotificationCompatJellybean.addBigPictureStyle(((NotificationCompat.BigPictureStyle)localObject).mBigContentTitle, ((NotificationCompat.BigPictureStyle)localObject).mSummaryTextSet, ((NotificationCompat.BigPictureStyle)localObject).mSummaryText, ((NotificationCompat.BigPictureStyle)localObject).mPicture, ((NotificationCompat.BigPictureStyle)localObject).mBigLargeIcon, ((NotificationCompat.BigPictureStyle)localObject).mBigLargeIconSet);
        }
      return localNotificationCompatJellybean.build();
    }
  }

  public static abstract class Style
  {
    NotificationCompat.Builder mBuilder;
    CharSequence mBigContentTitle;
    CharSequence mSummaryText;
    boolean mSummaryTextSet = false;

    public void setBuilder(NotificationCompat.Builder paramBuilder)
    {
      if (this.mBuilder != paramBuilder)
      {
        this.mBuilder = paramBuilder;
        if (this.mBuilder != null)
          this.mBuilder.setStyle(this);
      }
    }

    public Notification build()
    {
      Notification localNotification = null;
      if (this.mBuilder != null)
        localNotification = this.mBuilder.build();
      return localNotification;
    }
  }
}

/* Location:           D:\hygieia\userclient\common\libs\easemobchat_2.1.8.jar
 * Qualified Name:     com.easemob.chat.NotificationCompat
 * JD-Core Version:    0.6.1
 */